package org.knife.springbootlearn.security.app.service.impl;

import org.knife.springbootlearn.security.app.service.UserRoleService;
import org.knife.springbootlearn.security.domain.entity.TUser;
import org.knife.springbootlearn.security.domain.entity.TUserRole;
import org.knife.springbootlearn.security.infra.mapper.TUserDao;
import org.knife.springbootlearn.security.infra.mapper.TUserRoleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tianhao.luo@hand-china.com
 * @version 1.0
 * @date 2021年12月02日 星期四 9:24 上午
 * @description
 * @since 1.0
 */
@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private TUserDao userDao;

    @Autowired
    private TUserRoleDao tUserRoleDao;

    @Override
    public TUser selectByUserName(String userName) {
        return userDao.selectByUserName(userName);
    }

    @Override
    public List<TUserRole> listByUserName(String userName) {
        return tUserRoleDao.listUserRoleByUserName(userName);
    }
}
